<!--# layout("/common/layout.html",{"jsBase":"/js/trans/finTransaction/"}){ -->
<style>
    .div-layout{
        float:left;
        margin-left: 50px;
        width: 400px;
        margin-top: 20px;
    }
    .div-background-color{
        background-color: #c0c0c0;
    }
    .div-border{
        border:solid 1px #f0f0f0;
        background-color: #f9f9f9;
        height: 320px;
    }
    .div-border-2{
        border:solid 1px #f0f0f0;
        background-color: #f9f9f9;
        height: 250px;
    }

</style>
<div>
    <div >
        <div  class="div-layout">
            <div class="layui-card-header div-background-color">订单信息</div>
            <div class="div-border" >
                <div class="layui-card-body ">订单号:<span>${finTrans.transactionId}</span></div>
                <div class="layui-card-body">下单时间:<span>${finTrans.createTimeText}</span></div>
                <div class="layui-card-body">销售渠道:<span>${finTrans.channelName==null?'圣达信':finTrans.channelName}</span></div>
                <div class="layui-card-body">渠道代码:<span>${finTrans.channel}</span></div>
                <div class="layui-card-body">订单状态:<span>${finTrans.payFlagText}</span></div>
                <div class="layui-card-body">商品名称:<span>${finTrans.orderName}</span></div>
            </div>
        </div>
        <div class="div-layout">
            <div class="layui-card-header div-background-color">支付信息</div>
            <div class="div-border" >
                <div class="layui-card-body ">支付流水号: <span>${finTrans.tradeNo}</span></div>
                <div class="layui-card-body">支付时间: <span>${finTrans.payTimeText}</span></div>
                <div class="layui-card-body">支付类型: <span>${finTrans.payMethodText}</span></div>
                <div class="layui-card-body">支付金额: <span>￥${finTrans.totalMoney/100}</span></div>
            </div>
        </div>
        <div class="div-layout">
            <div class="layui-card-header div-background-color">买家信息</div>
            <div class="div-border" >
                <div class="layui-card-body ">用户Id: <span>${finTrans.userId}</span></div>
                <div class="layui-card-body">用户姓名: <span>${finTrans.customerName}</span></div>
                <div class="layui-card-body">用户电话: <span>${finTrans.tel}</span></div>
<!--                <div class="layui-card-body">用户性别: <span>${finTrans.customerName}</span></div>-->
                <div class="layui-card-body">高考省份: <span>${finTrans.provName}</span></div>
                <div class="layui-card-body">高考科目: <span>${finTrans.majorTypeText}</span></div>
                <div class="layui-card-body">高考分数: <span>${finTrans.score}</span></div>
            </div>
        </div>
    </div>
    <div>

        <div class="div-layout" style="width: 850px;">
            <div class="layui-card-header div-background-color">退款信息</div>
            <div class="div-border-2" >
                <div style="display:flex;">
                    <div class="layui-card-body " style="width: 350px">退款单号: <span>${finTrans.refundId}</span></div>
                    <div class="layui-card-body" style="width: 150px;">操作人: <span>${finTrans.operatorName}</span></div>
                    <div class="layui-card-body" style="margin-left: 20px">退款时间: <span>${finTrans.refundTimeText}</span></div>
                </div>
                <div style="display:flex;">
                    <div class="layui-card-body" style="width: 350px;">退款状态: <span>${finTrans.refundStatusText}</span></div>
                    <div class="layui-card-body"  >接口信息: <span>${finTrans.errorMsg}</span></div>
                </div>
                <div style="display:flex;">
                    <div class="layui-card-body">退款原因: <span>${finTrans.refundReason}</span></div>
                </div>
                <div style="display:flex;">
                    <div class="layui-card-body">附件:
                        <img src="${finTrans.attachFile}" height="100" width="100" onclick="show('${finTrans.attachFile}')"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--#} -->
<script>
layui.define([ 'form', 'laydate', 'table','finTransactionApi'], function(exports) {
    var form = layui.form;
    var finTransactionApi = layui.finTransactionApi;
    var index = layui.index;
    var isNew = true;
    <!--# if(!(isEmpty(finTransactionJson))){  -->
    isNew = false;
    <!--# } -->
    var view = {
        init: function () {
            Lib.initGenrealForm($("#addForm"), form);
            this.initSubmit();
        },
        initSubmit: function () {
            $("#addButton").click(function () {
                form.on('submit(form)', function () {
                    finTransactionApi.saveForm(isNew, $('#addForm'), function () {
                        parent.window.dataReload();
                        Common.info("保存成功");
                        Lib.closeFrame();
                    });
                });
            });

            $("#addButton-cancel").click(function () {
                Lib.closeFrame();
            });
        }
    }

    view.init();

    window.show = function (url) {
        if(!url){
            return;
        }
        var winHeight = $(window).height() - 80;  // 浏览器可视部分高度
        var winWidth = $(window).width() - 100;  // 浏览器可视部分宽度
        var imgHtml = "<img src='" + url + "' />";
        //捕获页
        layer.open({
            type: 1,
            // shade: false,
            shade: 0.8,
            offset: 'auto',
            shadeClose:true,
            scrollbar: false,
            skin:'layui-layer-nobg',
            title: false, //不显示标题
            area:[winWidth+'px',winHeight+'px'],
            // area: [600+'px', 600+'px'],
            content: imgHtml, //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响
            cancel: function () {
                //layer.msg('捕获就是从页面已经存在的元素上，包裹layer的结构', { time: 5000, icon: 6 });
            }
        });
    }
    <!--# if(!(isEmpty(finTransactionJson))){  -->
    var formJson = ${finTransactionJson};
    form.val("editform",formJson);
    <!--# } -->
});
</script>
